using codeparser.net.Contracts;

using System;

namespace codeparser.net
{
    /// <summary>
    /// Represents text.
    /// </summary>
    internal class Text : IToken
    {
        /// <summary>
        /// Contains the content.
        /// </summary>
        private string _content;

        /// <summary>
        /// Decides whether this instance is a special character.
        /// </summary>
        private bool _isSpecialCharacter;

        /// <summary>
        /// Gets or sets the content.
        /// </summary>
        /// <value>The content.</value>
        public string Content
        {
            get
            {
                return this._content;
            }

            set
            {
                this._content = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is a special character.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is a special character; otherwise, <c>false</c>.
        /// </value>
        public bool IsSpecialCharacter
        {
            get
            {
                return this._isSpecialCharacter;
            }
            set
            {
                this._isSpecialCharacter = value;
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Text"/> class.
        /// </summary>
        /// <param name="content">The content.</param>
        public Text(string content)
            : this(content, false)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Text"/> class.
        /// </summary>
        /// <param name="content">The content.</param>
        /// <param name="isSpecialCharacter">If set to <c>true</c>, this instance is a special character.</param>
        public Text(string content, bool isSpecialCharacter)
        {
            this._content = content;
            this._isSpecialCharacter = isSpecialCharacter;
        }
    }
}
